<template>
	<view class="TutorStatusCards" v-for="(item,index) in orderList" :key="index">
		<view class="card item" @tap="goDetails(item)">
			<view class="top">
				<view style="display: flex;align-items: center;">
					<tui-icon margin="4rpx" size="20" name="order"></tui-icon>
					<text>订单号：{{item.id}}</text>
				</view>
				<!-- 状态 0全部，
				CALL_FOR("1", "邀约中"),
				CONFIRMED("2", "已确认"),
				STAY_START("3", "待开始"),
				IN_SERVICE("4", "服务中"),
				STAY_EVALUATE("5", "待评价"),
				COMPLETED("6", "已完成"),
				CLOSED("7", "已关闭"),
				REFUSE("8", "拒绝"); -->
				<text class="invite" v-if="item.status*1===1">邀约中</text>
				<text class="invite" v-else-if="item.status*1===2">已确认</text>
				<text class="invite" v-else-if="item.status*1===4">服务中</text>
				<text class="invite" v-else-if="item.status*1===5">待评价</text>
				<text class="invite" v-else="item.status*1===6">已完成</text>
			</view>
			<view class="content">
				<view class="content_lt">
					<image v-if="item.assistant" class="image" :src="ossUrl+item.assistant.masterImg"></image>
				</view>
				<view class="content_rt" v-if="item.assistant">
					<view class="tp">
						<view class="tp_lt">
							<text>{{item.assistant.assistantName}}</text>
							<tui-icon margin="20rpx" size="20" name="order"></tui-icon>
						</view>
						<text class="tp_rt">￥{{item.orderAmount}}</text>
					</view>
					<view class="ct">
						<text class="ct_lt">{{item.assistant.categoryName}}</text>
						<text class="ct_rt">{{item.hourNumber}}小时</text>
					</view>
					<view class="bt">
						<text>￥{{item.assistant.rates}}/小时</text>
					</view>
				</view>
			</view>
			<view class="flex align-center justify-between mx-2 fs-24 ft777777 mb-1">
				<text>车程计价{{item.transportFeeUnitPrice||0}}元/km，全程{{item.distance || 0}}km</text>
				<view class="ft333333 flex align-center">车费：<text
						class="ft63d6d3 font-weight-bold fs-28">￥{{item.transportFee || 0}}</text></view>
			</view>
			<view class="bottom">
				<text>下单时间：{{item.orderTime}}</text>
				<view class="total"><text>合计:</text><text
						class="totalPrice">{{item.actualAmount ? '￥'+item.actualAmount : ''}}</text></view>
			</view>
			<view class="footer">
				<view class="button_item">
					<!-- <tui-form-button margin="0 0 0 20rpx" v-if="item.status*1===2" width="160rpx" size="28" height="60rpx" background="#63d6d3" radius="100rpx">立即支付</tui-form-button>
					<tui-form-button margin="0 0 0 20rpx" v-if="item.status*1===1||item.status*1===2" width="160rpx" size="28" height="60rpx" plain background="#63d6d3" color="#63d6d3" radius="100rpx">取消订单</tui-form-button>
					<tui-form-button margin="0 0 0 20rpx"  v-if="item.status*1===4" width="160rpx" size="28" height="60rpx" plain background="#63d6d3" color="#63d6d3" radius="100rpx">一件续费</tui-form-button>
					<tui-form-button margin="0 0 0 20rpx" v-if="item.status*1===1 || item.status*1===2  || item.status*1===4" width="160rpx" size="28" height="60rpx" background="#63d6d3" radius="100rpx">联系教练</tui-form-button>
					<tui-form-button margin="0 0 0 20rpx" v-if="item.status*1===5||item.status*1===6" width="160rpx" size="28" height="60rpx" plain background="#63d6d3" color="#63d6d3" radius="100rpx">删除订单</tui-form-button>
					<tui-form-button margin="0 0 0 20rpx" v-if="item.status*1===5" width="160rpx" size="28" height="60rpx" background="#63d6d3" radius="100rpx">立即评价</tui-form-button> -->
				</view>
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		name: 'order_item',
		props: {
			//教练信息
			orderList: {
				type: Array,
				// 1 邀约中 2 已确认 3服务中 4待评价 5 已完成
				default: []
			},
			//oss链接
			ossUrl: {
				type: String,
				default: null
			}

		},
		data() {
			return {

			};
		},
		methods: {
			goDetails(item) {
				uni.navigateTo({
					url: '/pages/tutorControl/modules/tutorList/compontents/orderItemDetails/orderItemDetails?orderId=' + item
						.id
				})
			}
		}
	};
</script>

<style lang="scss" scoped>
	@import './orderItem.scss';
</style>